Rich-formatting missing for Object Heading

Hi,

Am new to DXL, trying to replicate the Object Heading and Object Text using DXL.

Object Heading and Object Text

 

This is the code, I have created. 

 

void showObjText(Object o)
{
        string temp = richTextWithOle(o."Object Heading") richTextWithOle(o."Object Text")
        displayRich("\\pard " temp "\n")
}

showObjText(obj)

Am not getting the Heading in rich text formatting. Need Help.

Object Heading without rich text

 

Thanks.


Dk3456 - Wed Oct 17 20:47:50 EDT 2018

Re: Rich-formatting missing for Object Heading
davidcs - Thu Oct 18 10:13:29 EDT 2018

I copied your code into a Layout DXL and it displayed both the object heading and text with rich text formatting applied. Using version 9.6.1.11 of DOORS.

Re: Rich-formatting missing for Object Heading
PekkaMakinen - Thu Oct 18 10:27:53 EDT 2018

Yes, it should work as a Layout DXL column. Note though that Object Heading as a String type attribute cannot contain OLE objects: http://www-01.ibm.com/support/docview.wss?uid=swg21395443

Re: Rich-formatting missing for Object Heading
Mike.Scharnow - Thu Oct 18 11:52:31 EDT 2018

Perhaps you are confused that the heading is not shown the same way it is shown as Object Heading in the main column. This is because the format of an object heading is not stored as RTF, but the format is a user specific setting (Tools→Options→Display→Fonts→used in Headings), so, in order to mimic the main column you would have to apply these user specific settings as well somehow.

Re: Rich-formatting missing for Object Heading
Dk3456 - Thu Oct 18 12:56:31 EDT 2018

davidcs - Thu Oct 18 10:13:29 EDT 2018

I copied your code into a Layout DXL and it displayed both the object heading and text with rich text formatting applied. Using version 9.6.1.11 of DOORS.

Am using 9.6.1.8. It didn't work for me.

Re: Rich-formatting missing for Object Heading
Dk3456 - Thu Oct 18 12:58:35 EDT 2018

Mike.Scharnow - Thu Oct 18 11:52:31 EDT 2018

Perhaps you are confused that the heading is not shown the same way it is shown as Object Heading in the main column. This is because the format of an object heading is not stored as RTF, but the format is a user specific setting (Tools→Options→Display→Fonts→used in Headings), so, in order to mimic the main column you would have to apply these user specific settings as well somehow.

I believe this is the reason, but am not able to find the options. I also tried to append the Object Number and Object Heading and making it bold, but not able to access "Object Number".

Re: Rich-formatting missing for Object Heading
davidcs - Thu Oct 18 13:08:41 EDT 2018

Dk3456 - Thu Oct 18 12:56:31 EDT 2018

Am using 9.6.1.8. It didn't work for me.

I guess it could be a bug, but I somehow doubt it.

Here is what I did:

Insert -> Column -> Layout DXL -> Browse -> New -> Paste Code -> OK -> Insert

Re: Rich-formatting missing for Object Heading
Dk3456 - Thu Oct 18 13:27:51 EDT 2018

davidcs - Thu Oct 18 13:08:41 EDT 2018

I guess it could be a bug, but I somehow doubt it.

Here is what I did:

Insert -> Column -> Layout DXL -> Browse -> New -> Paste Code -> OK -> Insert

The problem is with the rich text format, I get the data, I have another code to insert as column :)

I guess, I need to do something related to getFontSettings and setFontSettings for Object Heading attributes.

 

Re: Rich-formatting missing for Object Heading
Mike.Scharnow - Thu Oct 18 14:52:37 EDT 2018

Dk3456 - Thu Oct 18 12:58:35 EDT 2018

I believe this is the reason, but am not able to find the options. I also tried to append the Object Number and Object Heading and making it bold, but not able to access "Object Number".

> but am not able to find the options. 

you can find it in the main window of doors, not in the module editor

 not able to access "Object Number".

string objNumber = number(o)

> do something related to getFontSettings

I'm not an RTF expert, so I can't help much, but generally I think you will have to create your own RTF string based on the font settings. There are possibilities with fonts in setRichClip, perhaps this can help you.

 

In general there is the question why you need to do this at all. why don't you just use the "main" column? Why do you have to mimic this main column exactly like the currently logged in user prefers his DOORS client layout? If you really have to mimic the complete behaviour of the main column, I think this will be a longer task, think e.g. of indentation and OLE Objects

Re: Rich-formatting missing for Object Heading
O.Wilkop - Fri Oct 19 02:15:11 EDT 2018

Look up the getCanvas() and font() functions in the Reference Manual, you can get the Canvas of the column and set the font to either HeadingFont or TextFont for the next displayRich(). Combine this with number(obj) and level(obj) and you can kind of re-create the main column

Re: Rich-formatting missing for Object Heading
EHcnck - Sat Oct 20 18:34:00 EDT 2018

Dk3456 - Thu Oct 18 13:27:51 EDT 2018

The problem is with the rich text format, I get the data, I have another code to insert as column :)

I guess, I need to do something related to getFontSettings and setFontSettings for Object Heading attributes.

 

http://www.smartdxl.com/content/?p=423

 

 

//      Recreate Main Column in Layout DXL

/*
        Layout DXL to display the Object Heading and Text
        in the same format as the main column.

        Tony Goodman
*/

if (obj."Object Heading" "" != "")
{
        font(getCanvas, level(obj), HeadingsFont)
        displayRich(number(obj) " " obj."Object Heading" "")
}

if (obj."Object Text" "" != "")
{
        font(getCanvas, level(obj), TextFont)
        displayRich(richTextWithOle(obj."Object Text"))
}

 

Re: Rich-formatting missing for Object Heading
Dk3456 - Mon Oct 22 12:52:20 EDT 2018

EHcnck - Sat Oct 20 18:34:00 EDT 2018

http://www.smartdxl.com/content/?p=423

 

 

//      Recreate Main Column in Layout DXL

/*
        Layout DXL to display the Object Heading and Text
        in the same format as the main column.

        Tony Goodman
*/

if (obj."Object Heading" "" != "")
{
        font(getCanvas, level(obj), HeadingsFont)
        displayRich(number(obj) " " obj."Object Heading" "")
}

if (obj."Object Text" "" != "")
{
        font(getCanvas, level(obj), TextFont)
        displayRich(richTextWithOle(obj."Object Text"))
}

 

 It worked after I replaced the HeadingsFont and TextFont with 1 and 0.

 

void showObjText(Object o)
{
        if (obj."Object Heading" "" != "")
        { 
                font(getCanvas, level(obj), 1)
                displayRich(number(obj) " " obj."Object Heading" "")
        }
        if (obj."Object Text" "" != "")
        { 
                font(getCanvas, level(obj), 0)
                displayRich(richTextWithOle(obj."Object Text"))
        }
}

showObjText(obj)